热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

V2Newpreset`v2mstaptdatlczsty`withAirtablereplacingGraphCMS(basedon`v2mstaptdgcmslczsty`)

Demoshttps://v2-mst-aptd-at-lcz-sty.vercel.app/usesthelatestbr


Demos
  • https://v2-mst-aptd-at-lcz-sty.vercel.app/ uses the latest branch commit

  • https://nrn-v2-mst-aptd-at-lcz-sty-c1.vercel.app/ is the production environment for Customer 1

  • https://nrn-v2-mst-aptd-at-lcz-sty-c1-preview.vercel.app/ is the preview/staging environment for Customer 1 (with Preview mode enabled)

  • https://nrn-v2-mst-aptd-at-lcz-sty-c2.vercel.app/ is the production environment for Customer 2

  • https://nrn-v2-mst-aptd-at-lcz-sty-c2-preview.vercel.app/ is the preview/staging environment for Customer 2 (with Preview mode enabled)

Status

This PR/branch is stable and has been added as the new official/default NRN preset.

Notes

This PR is not meant to be merged, but to provide a diff against the base branch (which is a preset using GraphCMS)

Objectives

The goal is to replace GraphQL API by Airtable API, for several reasons:
- Showcase how to consume a REST-ish API
- Easier to setup than GraphCMS
- Airtable provides a free plan, and has much higher limitations than GraphCMS for its free plan
- Requested https://github.com/UnlyEd/next-right-now/issues/16
- Make this the new default preset (simpler, cheaper)

Base preset: v2-mst-aptd-gcms-lcz-sty
New preset name: v2-mst-aptd-at-lcz-sty

Roadmap
  • ✅ Setup AT base and tables

  • ✅ Fetch data from AT API

  • ✅ Update TS data types (minor differences between GraphCMS schema and Airtable schema)

  • ✅ Consolidate all AT API calls into one (AT uses a REST API, which forces us to send 3 requests to fetch all the data we need)

  • ✅ Sanitise AT records

  • ✅ Handle content i18n (for each field, select the value for the most preferred locale if set, otherwise fallback to secondary locale)

  • ✅ Completely remove GraphQL/GraphCMS/Apollo related code (useless with this preset, should lower the bundle size quite a bit)

  • ✅ Update UIs to use data from Airtable

  • ✅ Optimise requests to Airtable API (use local cache, like https://github.com/alexreardon/memoize-one#readme)
    • WIP PR at https://github.com/UnlyEd/next-right-now/pull/92

    • Open issue at https://github.com/vercel/next.js/discussions/13765


  • ✅ Display images from Airtable (
    1
    AirtableAsset

    component)


  • Handle image optimisations (?)

  • ✅ Integrate Stacker as an admin backend (deal in progress) and configure it so that visitors can use it to update the data and see live changes

该提问来源于开源项目:UnlyEd/next-right-now

[GitHub Actions]
Deployment FAILED
Commit 5f8b8f798a833a2e72218e2339ac2ccdb46b20a3 failed to deploy to (click to see logs)


推荐阅读
author-avatar
梁梁庆新
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有